<?php

$cur_dir = dirname(__FILE__);
require_once $cur_dir . '/../models/TWtf.php';

class TestController {

    //登陆检查
    function loginAction() {
        $TWtf = new TWtf;
        $TWtf->uid = 111111;
        $TWtf->name = 'wangjinjiang';
        //$TWtf->create_time  = TimeUtils::getFullTime();
        if (!$TWtf->save()) {
            foreach ($TWtf->getMessages() as $message) {
                echo "Message: " . $message->getMessage() . "\n";
                echo "Field: " . $message->getField() . "\n";
                echo "Type: " . $message->getType() . "\n";
            }
        } else {
            echo "success\n";
        }
    }

}

echo "begin\n";
$test = new TestController;
$test->loginAction();
echo "end\n";

//function loginAction() {
//        $TWtf = new TWtf;
//        $TWtf->uid = 111111;
//        $TWtf->name = 'wangjinjiang';
//        //$TWtf->create_time  = TimeUtils::getFullTime();
//        if (!$TWtf->save()) {
//            foreach ($TWtf->getMessages() as $message) {
//                echo "Message: " . $message->getMessage() . "\n";
//                echo "Field: " . $message->getField() . "\n";
//                echo "Type: " . $message->getType() . "\n";
//            }
//        } else {
//            echo "success\n";
//        }
//    }
//    
//echo "begin\n";
//loginAction();
//echo "end\n";
